home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Hot Mix 17
/
Hot Mix 17.iso
/
HM17_SGI
/
research
/
examples
/
insight
/
plugins
/
myabs.pro
next >
Wrap
Text File
|
1997-07-08
|
2KB
|
85 lines
; $Id: myabs.pro,v 1.3 1997/04/22 16:21:58 rob Exp $
;
; Copyright (c) 1997, Research Systems, Inc. All rights reserved.
; Unauthorized reproduction prohibited.
;+
; FILE:
; myabs.pro
;
; PURPOSE:
; This file contains an example Conditioning PlugIn that does absolute
; value, without a dialog.
;
; CONTENTS:
; CALLBACK ROUTINE
; fun DoMyAbs - main entry point
;
; REGISTRATION FUNCTION
; fun MyAbs - registers the PlugIn
;
;-
FORWARD_FUNCTION ABS
; *****************************************************************************
; CALLBACK ROUTINE
; *****************************************************************************
; -----------------------------------------------------------------------------
;
; Purpose: Main entry point for the PlugIn.
;
function DoMyAbs, $
data, $ ; IN/OUT: the data to condition
GROUP=wGroup, $ ; IN: the widget group leader
_EXTRA=extra ; IN: (unused keywords)
; Get the type code.
;
size = SIZE(data)
type = size[size[0] + 1]
; Check for illegal data type (string).
;
if (type eq 7) then begin
message = 'This type is not supported for absolute value.'
void = DIALOG_MESSAGE(message, DIALOG_PARENT=wGroup)
RETURN, 0B
endif
; Do absolute value.
;
if (type ne 1) then $
data = ABS(data)
; Successful return.
;
RETURN, 1B
end ; DoMyAbs
; *****************************************************************************
; REGISTRATION FUNCTION
; *****************************************************************************
; -----------------------------------------------------------------------------
;
; Purpose: Register the Conditioning PlugIn.
;
function MyAbs
; Return the Conditioning PlugIn Registration Structure.
;
RETURN, { $
type: 'Conditioning_PlugIn', $ ; PlugIn type
title: 'My Abs', $ ; PlugIn title
purpose: 'Do absolute value.', $ ; PlugIn purpose
main_func: 'DoMyAbs', $ ; main callback
version: '5.0', $ ; IDL version
revision: '1.0' $ ; PlugIn version
}
end ; MyAbs
; -----------------------------------------------------------------------------